package com.alibaba.cloud.transmit.service.impl;

import com.alibaba.cloud.transmit.dao.TransmitMapper;
import com.alibaba.cloud.transmit.entity.TransmitData;
import com.alibaba.cloud.transmit.service.TransmitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class TransmitServiceImpl implements TransmitService {

    @Autowired
    private TransmitMapper transmitMapper;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void saveTransmitData(TransmitData transmitData) {

        transmitData.setCreateTime(new Date());
        transmitMapper.insert(transmitData);
    }
}
